import java.awt.Color;

public class lianxi_1 {

    private String name; //猫的名字

    private int age; //猫的年龄

    private double weight; //猫的重量

    private Color color; //猫的颜色

    public lianxi_1(String name, int age, double weight, Color color) {

        this.name=name;

        this.age=age;

        this.weight=weight;

        this.color=color;

    }

    public String toString() //重写toString()方法

    {

        StringBuilder s=new StringBuilder();

        s.append("名字："+name+"\n");

        s.append("年龄："+age+"\n");

        s.append("重量："+weight+"\n");

        s.append("颜色："+color+"\n");

        return s.toString();

    }

    public static void main(String[] args) {

        lianxi_1 cat1=new lianxi_1("java",12,21,Color.BLACK);

        lianxi_1 cat2=new lianxi_1("c++",12,21,Color.WHITE);

        lianxi_1 cat3=new lianxi_1("java",12,21,Color.BLACK);

        System.out.println("猫1号："+cat1);

        System.out.println("猫2号："+cat2);

        System.out.println("猫3号："+cat3);

    }

}